﻿<?php
require_once('../../../config.php');
define('AJAX_SCRIPT', true);
global $DB;

$program=$_GET["program"];


//neu dung sql thi phai co mdl_ truoc ten bang, con dung get_record

$sql="SELECT * FROM mdl_major ".
	  " WHERE program_id = '".$program."'";
$rs = $DB->get_records_sql($sql);

// echo html_writer::start_tag('Select',array('id'=>'major', 'name'=>'Majors[]', 'size'=>count($rs), 'multiple'=>'multiple'));
echo html_writer::start_tag('div',array('id'=>'major', 'name'=>'major'));
foreach ($rs as $r) {
	echo html_writer::start_tag('div');
	echo html_writer::tag('input',"&nbsp;".$r->major_name."&nbsp;&nbsp;&nbsp;", array('type'=>'checkbox','name'=>'major', 'value'=>$r->id)); 
	//echo html_writer::tag('option', $r->major_name, array('value'=>$r->id));	
	echo html_writer::end_tag('div');
}

echo html_writer::end_tag('div');

?>